package com.sxpi.zixun.controller.kfc;

import com.sxpi.zixun.common.anno.IgnoreToken;
import com.sxpi.zixun.common.enums.AdminUserResultEnum;
import com.sxpi.zixun.common.utils.fn.asserts.Vsserts;
import com.sxpi.zixun.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 董伟豪
 * @Date: 2022/8/11 11:43
 */
@RestController
@Slf4j
public class WantKFC extends BaseController {

    @IgnoreToken
    @GetMapping("/login/kfc")
    public void a(){
        log.error("Today is not Thursday, but I want to go to KFC, Please give me 100￥");
        log.info("Today is not Thursday, but I want to go to KFC, Please give me 100￥");
        log.warn("Today is not Thursday, but I want to go to KFC, Please give me 100￥");
        log.trace("Today is not Thursday, but I want to go to KFC, Please give me 100￥");
        Vsserts.isNotTrueEx(false,AdminUserResultEnum.KFC);
    }







    // break：用来终止switch和离它最近的循环语句
    // return：用来终止离他最近的一个方法
    public static void main(String[] args) {
        for(int i = 0;i < 10;i++){
            if(i == 5){
                System.out.println("HelloWorld");
                return;// 终止当前的方法，和break不是一个级别的
                // return 10;// 错误：不兼容的类型
            }
            System.out.println("i=" + i);
        }

    }
}
